package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"modulename/dao"
	"modulename/router"
)

// @title goWeb project
// @version 1.0
// @description this is goWeb server.
// @host 127.0.0.1:9000
func main() {
	service := gin.Default()
	// 设置图标
	service.StaticFile("/favicon.ico", "./static/favicon.png")
	// 连接数据库
	if err := dao.InitGormDB(); err != nil {
		fmt.Printf("init gorm failed, err:%v\n", err)
		return
	}
	fmt.Println("连接GORM MySQL数据库成功!")
	// 引入路由模块
	router.InitRouter(service)
	service.Run(":9000")
}
